<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>我的购物车  - ${web.name}${web.additionalTitle!}</title>
<style>
.box{ width:440px;}
.box li{ float:left; width:400px; height:100px; margin-right:10px;}
</style>
<link href="${root}/u/css/seasonpass.css" type="text/css"  rel="stylesheet"/>
<link href="${root}/u/css/product.css" type="text/css" rel="stylesheet" />
<link href="${root}/u/css/global.css" type="text/css" rel="stylesheet" />
<link href="${root}/u/css/layout.css" type="text/css" rel="stylesheet" />
<link href="${root}/u/css/pshow.css" type="text/css" rel="stylesheet" />
<script src="${root}/u/js/jquery.js" type="text/javascript"></script>
<script src="${root}/u/js/product.js"  type="text/javascript"></script>
</head>
<body>
    [#include "../include/页头顶栏.html"/]
<div id="head">
	[#include "../include/页头搜索栏.html"/]
    [#include "../include/页头导航栏.html"/]
</div>
<div class="w960">
<form id="jvForm" action="${base}/cart/add_popularity.jspx" method="post"> 
<div class="w">
    <div id="suit" class="m">
        <div class="mt">
            <dl class="suit-info">
                <dt>优惠套装：</dt>
                <dd>
                    <div class="p-market">原价：￥<del>${popularityGroup.price!}</del></div>
                    <div class="p-price"><span>套装价：</span><em>￥</em><strong>${popularityGroup.price-popularityGroup.privilege}</strong></div>
                </dd>
            </dl>
            <div class="explain">说明：一次购买，同一套装只能选择一组规格；<br></div>
            <div class="clr"></div>
        </div>
        <div class="mc">
            <h3>请选择商品规格：</h3>
            <ul id="suit-list">
		[#list popularityGroup.products as product]
		<li class='fore' id="sku0" data-sku="1267968">
			<div class='p-img'>
				<a href='${product.url!}' title='${product.name!}'><img src='${root!}${product.productExt.coverImg!}' width="100" height="100" alt='${product.name!}'></a>
			</div>
			<ul class='summary'>
				<li class='summary-name'>
					<strong>[套装商品${product_index+1}]</strong><a href='${product.url!}'>${product.name!}</a>
					  [#if product.category.colorsize]
				     	<div class="sys_item_spec">
				     	[#list product.category.standardTypes as standardType]
				     		[#if standardType.dataType]
				     			<dl class="sys_item_specpara clearfix" data-sid="${standardType_index+1}" 
				     				[#list product.productFashion.nature?split("_") as arr]
									[#if standardType_index=arr_index]data-attrval="${arr}" [/#if]
									[/#list]>
									<dt>${standardType.name}</dt>
									<dd>
										<ul class="sys_spec_img">
										      [#list product.productStandards as ps]
						               	        [#if standardType.id=ps.type.id]
						                    		<li data-aid="${ps.standard.id!}" [#if product.productFashion.standards?seq_contains(ps.standard)]class="selected"[#else]class=""[/#if]><a href="javascript:;" title="${ps.standard.name}"><img src="${root!}${ps.imgPath!}" alt="${ps.standard.name}" /></a><i></i></li>
										  		[/#if]
						                      [/#list]
										</ul>
									</dd>
							   </dl>
						   [#else]
								<dl class="sys_item_specpara clearfix" data-sid="${standardType_index+1}" 
								    [#list product.productFashion.nature?split("_") as arr]
										[#if standardType_index=arr_index]data-attrval="${arr}" [/#if]
									[/#list]>
									<dt>${standardType.name}</dt>
									<dd>
										<ul class="sys_spec_text">
										 [#list product.productStandards as ps]
						               	    [#if standardType.id=ps.type.id]
												<li data-aid="${ps.standard.id!}" [#if product.productFashion.standards?seq_contains(ps.standard)]class="selected"[#else]class=""[/#if]><a href="javascript:;" title="${ps.standard.name}">${ps.standard.name}</a><i></i></li>
											[/#if]
						                 [/#list]
										</ul>
									</dd>
								</dl>
							[/#if]
						[/#list]
						</div>
						<input type="hidden" id="fashId${product.id}" name="fashId" value='${product.productFashion.id!}'/>
						 <script language="JavaScript" type="text/JavaScript">
					        var sys_item={
								[#if product.productFashion??]
										"fashId":"${product.productFashion.id!}",
						        [#else]
								"fashId":"",
								[/#if]
								"sys_attrprice":{
									[#list product.fashions as fash]
									 [#if fash_has_next]
									  "${fash.nature!}":{"fashId":"${fash.id!}"},
						             [#else]
						              "${fash.nature!}":{"fashId":"${fash.id!}"}
									 [/#if]
									[/#list]
								}
							};
							//商品规格选择
							$(function(){
								$(".sys_item_spec .sys_item_specpara").each(function(){
									var i=$(this);
									var p=i.find("ul>li");
									p.click(function(){
										
										if(!!$(this).hasClass("selected")){
											$(this).removeClass("selected");
											i.removeAttr("data-attrval");
										}else{
											$(this).addClass("selected").siblings("li").removeClass("selected");
											i.attr("data-attrval",$(this).attr("data-aid"))
										}
										getattrprice() //输出价格
									})
								})
								//获取对应属性的价格
								function getattrprice(){
									var defaultstats=true;
									var _val='';
									$(".sys_item_spec .sys_item_specpara").each(function(){
										var i=$(this);
										var v=i.attr("data-attrval");
										if(!v){
											defaultstats=false;
										}else{
											_val+=_val!=""?"_":"";
											_val+=v;
										}
									})
										if((sys_item['sys_attrprice'][_val])!=undefined){
											_fashId=sys_item['sys_attrprice'][_val]['fashId'];
										}else{
											alert(1);
											_fashId=sys_item['fashId'];
										}
									//输出价格
									$("#fashId${product.id}").val(_fashId);
								}
							})

</script>
					 [/#if]	
	 
				</li>
			</ul>
		</li>
		[/#list]            
            </ul>
        </div>
        <div class="mb">
            <dl class="suit-info">
                <dt>优惠套装：</dt>
                <dd>
                    <div class="p-market">原价：￥<del>${popularityGroup.price!}</del></div>
                    <div class="p-price"><span>套装价：</span><em>￥</em><strong>${popularityGroup.price-popularityGroup.privilege}</strong></div>
					<div class="p-saveup">立省：￥<strong>${popularityGroup.privilege!}</strong></div>
                </dd>
            </dl>				
				<input type="hidden" id="popularityId" name="popularityId" value='${popularityGroup.id!}'/>
			       <input type="hidden" name="pId" value='${fromProduct.id!}'/>
			     <input type="submit" value="购买"/>
		   
        </div>
    </div>
</div>
</form> 
</div>
[#include "../include/footer_information_bar.html"/]

</body>
</html>
